package factory.simple;

import factory.goods.*;

/**
 * User:xuzhidian
 * Date:2018/3/13
 * Time:22:19
 */
public class SimplePizzaFactory {
    public IPizza createPizza(String type) {
        IPizza pizza;
        if (type.equals("cheese")) {
            pizza = new CheesePizza();
        } else if (type.equals("greek")) {
            pizza = new GreekPizza();
        } else if (type.equals("pepperoni")) {
            pizza = new PepperoniPizza();
        } else {
            pizza = new Pizza();
        }
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }


}
